Traditional hardware approaches for protecting data memory partition the memory so that a memory area used for one application may be inaccessible to another application. This approach has been implemented by software that partitions memory as well. The partitioning software may provide broad memory partitions similar to the traditional hardware approach. Additionally, the partitioning software may provide partitions of memory within an application. That is, if a software application has ten broad instruction groups, then the partitioning software may prevent memory associated with a first instruction group to be accessed by a second instruction group. Additionally, such partitioning software may enforce policies such as a first region of memory is only executable, while a second region may be written to or read.
A problem associated the partitioning software, however, is that it may provide only coarse, simplistic control for memory protection. It may implement an assumption that the same security policies used in hardware for memory access should apply broadly in software. For example, it may not allow different security policies to be applied to pieces of data memory that are smaller than the broad memory partitions associated with typical partitioning approaches. It also may not apply security policies that depend on individual code instructions. Additionally, the partitioning software may require checks to be inserted throughout a function to ensure that the partitioning is in effect even in the event of unusual or unexpected flows of control (including those that possibly may be caused by an attacker). For example, a check may be performed before a read operation, then the read operation may be completed, and then a second check may be performed before a write operation is performed. The second check may be needed if it cannot be determined that control flow can reach the write operation only after having gone through the check associated with the read operation. This is a cumbersome process that greatly reduces the practical value of such partitioning software.
Therefore, there is a need for memory access control that provides a higher degree of control over the policies implemented for data memory access. There is also a need for the memory access control to ensure control flow integrity without necessitating cumbersome verification.